package com.java.manage.controller;

import com.java.common.model.Result;
import com.java.manage.model.Inventory;
import com.java.manage.service.InventoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/inventory")
public class InventoryController {

    //库存管理
    @Autowired
    private InventoryService inventoryService;

    @PostMapping("/list")
    public Result list(@RequestBody Inventory inventory) {
        return inventoryService.list(inventory);
    }

    @GetMapping("/lists")
    public Result lists(Integer id) {
        return inventoryService.lists(id);
    }

    @PostMapping("/save")
    public Result save(@RequestBody Inventory inventory) {
        return inventoryService.save(inventory);
    }

    @PostMapping("/modify")
    public Result modify(@RequestBody Inventory inventory) {
        return inventoryService.modify(inventory);
    }

    @PostMapping("/remove")
    public Result remove(int[] ids) {
        return inventoryService.remove(ids);
    }
}
